package com.hmsg.health.dao;

import com.hmsg.health.bean.domain.AdminSystemDo;
import com.hmsg.health.bean.vo.AdminSystemReqVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface AdminSystemDao {

    @Update({"<script>",
            "update t_admin_system",
            "<trim prefix='set' suffixOverrides=','>",
            "<if test='adminSystemReqVo!=null'>",
            " `is_open`=#{adminSystemReqVo.isOpen},",
            "</if>",
            "</trim>",
            " where id = #{adminSystemReqVo.id}",
            "</script>"})
    void update(@Param("adminSystemReqVo") AdminSystemReqVo adminSystemReqVo);

    @Select("select * from t_admin_system")
    AdminSystemDo find();
}
